<?php
require_once("checklogin.php");
require_once("classQuanTriTin.php");
$qt = new quantritin;

$idTin=-1;
if (isset($_GET['idTin'])==false) die('Không biết tin nào'); 
$idTin = $_GET['idTin']; 	
$tin = $qt->ChiTietSoLanXem($idTin);
$row_tin = mysql_fetch_row($tin);

$slx_max = $qt->SoLanXemCaoNhat();
$row_max = mysql_fetch_row($slx_max);

if (isset($_POST['btnOK'])==true) {
	$qt->ChinhSoLanXem($idTin);
	header("location:main.php?p=tintuc_list");
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tin tuc chinh</title>
<style>
#NewsDetail {
	width: 400px;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-color: #030;
	border-right-color: #030;
	border-bottom-color: #030;
	border-left-color: #030;
}
#from_label {
	height: 38px;
	width: 400px;
	background-color: #FFFFFF;
}

#from_label_left {
	background-image: url(../images/from_logo_left.jpg);
	background-repeat: no-repeat;
	float: left;
	height: 38px;
	width: 19px;
}
#from_label_right {
	background-image: url(../images/from_logo_right.jpg);
	background-repeat: no-repeat;
	float: right;
	height: 38px;
	width: 19px;
}
#from_label_center {
	background-image: url(../images/from_logo_center.jpg);
	background-repeat: repeat-x;
	height: 38px;
	margin-right: 19px;
	margin-left: 19px;
	text-align: center;
	color: #FFFFFF;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	padding-top: 5px;
	width: 362px;
}

#btnOK{
	background-color:#862B2F;
	color:#D28286;
	width:80px;
	padding:3px;
	border:1px solid #E1AAAD;
	font-size: 12px;
	font-weight: bolder;
}
#NewsDetail td{
	border-bottom-width: 1px;
	border-bottom-style: solid;
	border-bottom-color: #FFFFFF;
	border-top-width: 1px;
	border-top-style: solid;
	border-top-color: #FFFFFF;
}
.left {
	background-color: #FFDDDD;
}
.from_label1 {
	background-color: #FFFFFF;
}
#NewsDetail th {
	width: 200px;
	border-bottom-style: solid;
	border-bottom-color: #FFFFFF;
	background-color: #FFDDDD;
	border-bottom-width: 1px;
	border-top-width: 1px;
	border-top-style: solid;
	border-top-color: #FFFFFF;
}
#NewsDetail .txt{
	color:#FFFFFF;
	background-color:#A8353C;
	width:100px;
	border:solid 1px #963;
	padding-top:3px;
	padding-bottom:3px;
	font-weight: bolder;
}
#NewsDetail #TomTat, #NewsDetail #Content{ height:75px }
#NewsDetail #idTL, #NewsDetail #idLT {
	background-color: #A8353C;
	width: 180px;
	border: 1px solid #009999;
	color: #FFDDDD;
	font-weight: bold;
}
#NewsDetail #btnXoa, #NewsDetail #btnOK {
	color: #99FF00; background-color: #003366;
	width: 80px; padding-top: 3px; padding-bottom: 3px;
}
#btnXoa {
	background-color:#862B2F;
	color:#D28286;
	width:80px;
	padding:3px;
	border:1px solid #E1AAAD;
	font-size: 12px;
	font-weight: bolder;
}
.white {
	background-color: #FFFFFF;
}
.text {
	font-size: 13px;
	text-align: right;
	color: #4A0000;
}
</style>

</head>

<body>
<form id="formNewsDetail" name="formNewsDetail" method="post" action="">
<table width=400 border=0 align=center cellpadding=4 cellspacing=0 id=NewsDetail>
<tr class="white">
  <th colspan="4" class="white">
    <div id="from_label">
    <div id="from_label_left"></div>
  	<div id="from_label_right"></div>
  	<div id="from_label_center"><span id="header">CHỈNH SỐ LẦN XEM</span></div>
  </div>  </th>
  </tr>
<tr>
  <th colspan="4"><center><?=$row_tin[0]?></center></th>
  </tr>
<tr>
  <th class="text">Số lần xem hiện tại</th>
  <td colspan="3"><label>
    <input name="slx_cu" type="text" class="txt" id="slx_cu" value="<?=$row_tin[1]?>" disabled="disabled" />
  </label></td>
</tr>
<tr>
  <th width="290" class="text">Số lần xem cao nhất</th>
  <td width="102" colspan="3"><label>
    <input name="slx_max" type="text" class="txt" id="slx_max" value="<?=$row_max[0]?>" disabled="disabled" />
  </label></td>
</tr>
<tr>
  <th class="text">Số lần xem mới</th>
    <td colspan="3"><label>
      <input name="slx_moi" type="text" class="txt" id="slx_moi" onclick="if(this.value=='Nhập số mới') this.value=''" onblur="if(this.value=='') this.value='Nhập số mới'" />
    </label></td>
</tr>
<tr></tr>
</table>
<div align=center>
<input type="reset" name="btnXoa" id="btnXoa" value=" Xoá " />
&nbsp;
<input type="submit" onclick="return alert('Chỉnh thành công');" name="btnOK" id="btnOK" value="  OK  " />
</div>
</form>

</body>
</html>
